package com.tekj.cxqcb.view.Module.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.tekj.cxqcb.R;
import com.tekj.cxqcb.operation.resultBean.SelectExpandListBean;

import java.util.List;

/**
 * 渠道拓展列表
 */
public class DevelopmentRecordAdapter extends BaseQuickAdapter<SelectExpandListBean.DataBean.ListBean, BaseViewHolder> {

    String types[] = {"", "待付款", "审核中", "已通过", "未通过", "已取消"};

    public DevelopmentRecordAdapter(@Nullable List<SelectExpandListBean.DataBean.ListBean> data) {
        super(R.layout.item_development_record, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SelectExpandListBean.DataBean.ListBean item) {
        helper.setText(R.id.tv_name, "真实姓名：" + item.getName());

        helper.setText(R.id.tv_num, "加盟审批单号：" + item.getOrderId());

        helper.setText(R.id.tv_phone, "电话：" + item.getPhone());

        helper.setText(R.id.tv_type, types[item.getState()]);
        helper.setTextColor(R.id.tv_type, mContext.getResources().getColor(
                (item.getState() == 4 || item.getState() == 5) ? R.color.red : R.color.colorPrimary));


        helper.setText(R.id.tv_time, "提交时间：" + item.getTime());
    }
}
